package adv_pre;

import java.util.*;

public class SetTest2 {

	public static void main(String[] args) {
		Set set = new HashSet();
		set.add("天猫");
		set.add(new News(1, "双十一花了一毛", "老刘", null));
		set.add(new News(2, "双十一花了一毛", "老朱", null));
		set.add(new News(3, "双十一花了一毛", "老吴", null));
		set.add(new News(4, "双十一花了一毛", "老赵", null));
		News n4 = new News(15, "多过手了", "新华社发布", null);
		set.add(n4);
		set.add("java");
		set.add(55);
		set.add(76);
		System.out.println(set.size());
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>");
		System.out.println(set);
		boolean in = set.contains("天猫");
		System.out.println("tianmao in?" + in);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>");
		n4.setTitle("双十一的红包其实今天还能用！");
		System.out.println(set);
		System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>");
		Iterator ir = set.iterator();
		while (ir.hasNext()) {
			Object o = ir.next();
			System.out.println(">>" + o);
		}
	}
}
